{% extends 'layouts/base.html' %}

{% block title %}Course Scheduling{% endblock %}
{% block meta_description %}Course Scheduling Output{% endblock %}

{% block body %}
  <div class="container sm-margin-top">
    <div class="row text-center lg-margin-bottom">
      <h1>Feeling lucky?</h1>
      <h3 class="text-muted">
        Your Generated Schedule
      </h3>
    </div>
    <div class="row text-center">
      <table class="table table-bordered">
        <thead>
          <tr>
            <th class="text-center">quarter</th>
            <th class="text-center"> cur units </th>
            <th class="text-center" colspan="{{ row_length }}">courses</th>
          </tr>
        </thead>
        <tbody>
        {% for index in range(schedule.L|length) %}
          <tr>
            <th scope="row">{{ index }}</th>
            <td>{{ schedule.curWidths[index] }}</td>
              {% for col in range(row_length) %}
                  {% if col < schedule.L[index]|length %}
                      <td>{{ schedule.L[index][col] }}</td>
                  {% else %}
                      <td> </td>
                  {% endif%}
              {% endfor %}
          </tr>
        {% endfor %}
        </tbody>
      </table>
    </div>
  </div>
{% endblock %}
